<?php
/**
 * User: Drery
 * Date: 2015/12/24
 * Time: 14:54
 */

namespace backend\components\grid;

use yii\grid\DataColumn;

class MyDataColumn extends DataColumn
{
    /* @var MyGridView*/
    public $grid;

    public $filterOnly;

    public function init()
    {
        parent::init();
    }

    public function renderFilterCell()
    {
        if ($this->grid->filterPosition == MyGridView::FILTER_POS_TOP)
            return $this->renderFilterCellContent();
        return parent::renderFilterCell();
    }

    public function renderHeaderCell()
    {
        if ($this->filterOnly) {
            return '';
        }
        return parent::renderHeaderCell(); // TODO: Change the autogenerated stub
    }

    public function renderFooterCell()
    {
        if ($this->filterOnly) {
            return '';
        }
        return parent::renderFooterCell(); // TODO: Change the autogenerated stub
    }

    public function renderDataCell($model, $key, $index)
    {
        if ($this->filterOnly) {
            return '';
        }
        return parent::renderDataCell($model, $key, $index); // TODO: Change the autogenerated stub
    }
}